﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using EasySL.Controls;

namespace EasySL.UI.Controls
{
    public partial class ExDataGridSample2 : UserControl
    {
        public ExDataGridSample2()
        {
            InitializeComponent();

            Random rd = new Random();

            List<NoteBook> products = new List<NoteBook>();
            for (int i = 1; i < 23; i++)
            {
                NoteBook product = new NoteBook();
                product.Name = "P" + (1000 + i).ToString();
                product.Price = rd.Next(100, 400);
                product.Price1 = rd.Next(50, 60);
                product.Price2 = product.Price - product.Price1;
                product.Rate = Convert.ToDouble(rd.Next(10000, 99999)) / 100000;
                product.Category = "C" + (i%6).ToString();
                product.Introduce = "I" + (1000 + i).ToString();
                product.Url = "http://www.google.com/search?&q=" + product.Introduce;

                products.Add(product);
            }

            this.dg.ItemsSource = products;
        }

    }
}
